import { Message } from 'element-ui'

// 成功通知
function success(message) {
    Message.success({
        showClose: true,
        message,
        customClass: 'ckt-message-success',
        iconClass: 'ckt-message-success-icon'
    })
}
// 失败通知
function error(message) {
    Message.error({
        showClose: true,
        message,
        customClass: 'ckt-message-error',
        iconClass: 'ckt-message-error-icon'
    })
}
// 警告通知
function warning(message) {
    Message.warning({
        showClose: true,
        message,
        customClass: 'ckt-message-warning',
        iconClass: 'ckt-message-warning-icon'
    })
}

// 消息通知
function info(message) {
    Message.info({
        showClose: true,
        message,
        customClass: 'ckt-message-info',
        iconClass: 'ckt-message-info-icon'
    })
}

function _Msg() {
    return {
        info,
        warning,
        error,
        success
    }
}
const Msg = new _Msg()

export default Msg